/*
 * =====================================================================================
 *
 *       Filename:  Emperor2.cc
 *
 *    Description:
 *
 *        Version:  1.0
 *        Created:  09/10/21 13:26:08
 *       Revision:  none
 *       Compiler:  gcc
 *
 *         Author:  XXXXXXX (), liushuyong@yidao.com
 *        Company:  YiDao
 *        Copyright:  Copyright 2021, XXXXXXX
 *
 * =====================================================================================
 */
#include "Emperor2.h"
#include "Log.h"
#include "string"

//懒汉模式

using std::string;

static const string TAG = "Emperor2";
Emperor2* Emperor2::mpEmperor2 = NULL;
mutex Emperor2::mInitMutex;

Emperor2::Emperor2(): IEmperor("Emperor2") {
    LogI("New");
}

Emperor2::~Emperor2() {
    LogI("Del");
}

void Emperor2::Test() {
    LogI("In");
}

Emperor2* Emperor2::GetInstance() {
    if (mpEmperor2 == NULL) {
        mInitMutex.lock();

        if (mpEmperor2 == NULL) {
            mpEmperor2 = new Emperor2();
        }

        mInitMutex.unlock();
    }

    return mpEmperor2;
}
